#!/usr/bin/env python  
# encoding: utf-8

""" 
@version: v1.0
@author: luojing
@license: Apache Licence
@contact: 362451785@qq.com
@site:
@software: PyCharm 
@file: ftp_demo.py 
@time: 2018/1/12 9:21 
"""
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# 实例化DummyAuthorizer来创建ftp用户
authorizer = DummyAuthorizer()

# 参数：用户名，密码，目录，权限
authorizer.add_user('user', '12345', 'E:/20180108', perm='elradfmwMT')


handler = FTPHandler
handler.authorizer = authorizer

server = FTPServer(('192.168.125.166', 21), handler)
server.serve_forever()